package com.videri.match.client;

import java.io.Serializable;
import java.util.ArrayList;

import com.google.gwt.user.client.rpc.IsSerializable;

public class ChatMessageList implements IsSerializable, Serializable{

	private static final long serialVersionUID = 8201362398533802143L;
	public String[] usernames;
	public String[] messages;
	public boolean[] isPrivate;
	
	public ChatMessageList()
	{
	}
	
	public ChatMessageList(String[] un, String[] m, boolean[] p)
	{
		usernames = un;
		messages = m;
		isPrivate = p;
	}
	
	public ChatMessageList(ArrayList un, ArrayList m, ArrayList p)
	{
		if(un.size() != m.size() || un.size() != p.size())
		{
			System.err.println("ChatMessageList constructor size mismatch:\n");
		    System.err.println("un: "+un.size()+", m: "+m.size()+", p: "+p.size());
		}
		else
		{
			usernames = new String[un.size()];
			messages = new String[m.size()];
			isPrivate = new boolean[p.size()];
			for(int i = 0; i < un.size(); i++)
			{
				usernames[i] = (String) un.get(i);
				messages[i] = (String) m.get(i);
				isPrivate[i] = ((Boolean) p.get(i)).booleanValue();
			}
		}
	}
	
}
